3.5.62 \(\int \frac {(c+d \sin (e+f x))^4}{(a+a \sin (e+f x))^2} \, dx\) [462]

Optimal. Leaf size=195 \[ \frac {d^2 \left (12 c^2-16 c d+7 d^2\right ) x}{2 a^2}+\frac {2 d \left (c^3+8 c^2 d-20 c d^2+8 d^3\right ) \cos (e+f x)}{3 a^2 f}+\frac {d^2 \left (2 c^2+16 c d-21 d^2\right ) \cos (e+f x) \sin (e+f x)}{6 a^2 f}-\frac {(c-d) (c+8 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 a^2 f (1+\sin (e+f x))}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^3}{3 f (a+a \sin (e+f x))^2} \]

[Out]

1/2*d^2*(12*c^2-16*c*d+7*d^2)*x/a^2+2/3*d*(c^3+8*c^2*d-20*c*d^2+8*d^3)*cos(f*x+e)/a^2/f+1/6*d^2*(2*c^2+16*c*d-
21*d^2)*cos(f*x+e)*sin(f*x+e)/a^2/f-1/3*(c-d)*(c+8*d)*cos(f*x+e)*(c+d*sin(f*x+e))^2/a^2/f/(1+sin(f*x+e))-1/3*(
c-d)*cos(f*x+e)*(c+d*sin(f*x+e))^3/f/(a+a*sin(f*x+e))^2

________________________________________________________________________________________

Rubi [A]
time = 0.24, antiderivative size = 195, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.120, Rules used = {2844, 3056, 2813} \begin {gather*} \frac {d^2 \left (2 c^2+16 c d-21 d^2\right ) \sin (e+f x) \cos (e+f x)}{6 a^2 f}+\frac {d^2 x \left (12 c^2-16 c d+7 d^2\right )}{2 a^2}+\frac {2 d \left (c^3+8 c^2 d-20 c d^2+8 d^3\right ) \cos (e+f x)}{3 a^2 f}-\frac {(c-d) (c+8 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 a^2 f (\sin (e+f x)+1)}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^3}{3 f (a \sin (e+f x)+a)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*Sin[e + f*x])^4/(a + a*Sin[e + f*x])^2,x]

[Out]

(d^2*(12*c^2 - 16*c*d + 7*d^2)*x)/(2*a^2) + (2*d*(c^3 + 8*c^2*d - 20*c*d^2 + 8*d^3)*Cos[e + f*x])/(3*a^2*f) +
(d^2*(2*c^2 + 16*c*d - 21*d^2)*Cos[e + f*x]*Sin[e + f*x])/(6*a^2*f) - ((c - d)*(c + 8*d)*Cos[e + f*x]*(c + d*S
in[e + f*x])^2)/(3*a^2*f*(1 + Sin[e + f*x])) - ((c - d)*Cos[e + f*x]*(c + d*Sin[e + f*x])^3)/(3*f*(a + a*Sin[e
 + f*x])^2)

Rule 2813

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(2*a*c +
 b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Cos[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 2844

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[(b*c - a*d)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n - 1)/(a*f*(2*m + 1))), x] + Dist[1/
(a*b*(2*m + 1)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n - 2)*Simp[b*(c^2*(m + 1) + d^2*(n -
1)) + a*c*d*(m - n + 1) + d*(a*d*(m - n + 1) + b*c*(m + n))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e,
f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[m, -1] && GtQ[n, 1] && (IntegersQ
[2*m, 2*n] || (IntegerQ[m] && EqQ[c, 0]))

Rule 3056

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(A*b - a*B)*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x]
)^n/(a*f*(2*m + 1))), x] - Dist[1/(a*b*(2*m + 1)), Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^(n -
1)*Simp[A*(a*d*n - b*c*(m + 1)) - B*(a*c*m + b*d*n) - d*(a*B*(m - n) + A*b*(m + n + 1))*Sin[e + f*x], x], x],
x] /; FreeQ[{a, b, c, d, e, f, A, B}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ
[m, -2^(-1)] && GtQ[n, 0] && IntegerQ[2*m] && (IntegerQ[2*n] || EqQ[c, 0])

Rubi steps

\begin {align*} \int \frac {(c+d \sin (e+f x))^4}{(a+a \sin (e+f x))^2} \, dx &=-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^3}{3 f (a+a \sin (e+f x))^2}-\frac {\int \frac {(c+d \sin (e+f x))^2 \left (-a \left (c^2+5 c d-3 d^2\right )+a (2 c-5 d) d \sin (e+f x)\right )}{a+a \sin (e+f x)} \, dx}{3 a^2}\\ &=-\frac {(c-d) (c+8 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 a^2 f (1+\sin (e+f x))}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^3}{3 f (a+a \sin (e+f x))^2}-\frac {\int (c+d \sin (e+f x)) \left (-a^2 (19 c-16 d) d^2+a^2 d \left (2 c^2+16 c d-21 d^2\right ) \sin (e+f x)\right ) \, dx}{3 a^4}\\ &=\frac {d^2 \left (12 c^2-16 c d+7 d^2\right ) x}{2 a^2}+\frac {2 d \left (c^3+8 c^2 d-20 c d^2+8 d^3\right ) \cos (e+f x)}{3 a^2 f}+\frac {d^2 \left (2 c^2+16 c d-21 d^2\right ) \cos (e+f x) \sin (e+f x)}{6 a^2 f}-\frac {(c-d) (c+8 d) \cos (e+f x) (c+d \sin (e+f x))^2}{3 a^2 f (1+\sin (e+f x))}-\frac {(c-d) \cos (e+f x) (c+d \sin (e+f x))^3}{3 f (a+a \sin (e+f x))^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 1.25, size = 378, normalized size = 1.94 \begin {gather*} \frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (3 d \left (64 c^3+48 c^2 d (-4+3 e+3 f x)-32 c d^2 (-5+6 e+6 f x)+7 d^3 (-7+12 e+12 f x)\right ) \cos \left (\frac {1}{2} (e+f x)\right )-\left (16 c^4+128 c^3 d+48 c^2 d^2 (-10+3 e+3 f x)-16 c d^3 (-41+12 e+12 f x)+d^4 (-239+84 e+84 f x)\right ) \cos \left (\frac {3}{2} (e+f x)\right )+3 \left ((16 c-5 d) d^3 \cos \left (\frac {5}{2} (e+f x)\right )+d^4 \cos \left (\frac {7}{2} (e+f x)\right )+2 \left (8 c^4+32 c^3 d-144 c^2 d^2+144 c d^3-50 d^4+96 c^2 d^2 e-128 c d^3 e+56 d^4 e+96 c^2 d^2 f x-128 c d^3 f x+56 d^4 f x+d^2 \left (48 c^2 (e+f x)-64 c d (1+e+f x)+d^2 (27+28 e+28 f x)\right ) \cos (e+f x)-2 (8 c-3 d) d^3 \cos (2 (e+f x))+d^4 \cos (3 (e+f x))\right ) \sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{48 a^2 f (1+\sin (e+f x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Sin[e + f*x])^4/(a + a*Sin[e + f*x])^2,x]

[Out]

((Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*(3*d*(64*c^3 + 48*c^2*d*(-4 + 3*e + 3*f*x) - 32*c*d^2*(-5 + 6*e + 6*f*x
) + 7*d^3*(-7 + 12*e + 12*f*x))*Cos[(e + f*x)/2] - (16*c^4 + 128*c^3*d + 48*c^2*d^2*(-10 + 3*e + 3*f*x) - 16*c
*d^3*(-41 + 12*e + 12*f*x) + d^4*(-239 + 84*e + 84*f*x))*Cos[(3*(e + f*x))/2] + 3*((16*c - 5*d)*d^3*Cos[(5*(e
+ f*x))/2] + d^4*Cos[(7*(e + f*x))/2] + 2*(8*c^4 + 32*c^3*d - 144*c^2*d^2 + 144*c*d^3 - 50*d^4 + 96*c^2*d^2*e
- 128*c*d^3*e + 56*d^4*e + 96*c^2*d^2*f*x - 128*c*d^3*f*x + 56*d^4*f*x + d^2*(48*c^2*(e + f*x) - 64*c*d*(1 + e
 + f*x) + d^2*(27 + 28*e + 28*f*x))*Cos[e + f*x] - 2*(8*c - 3*d)*d^3*Cos[2*(e + f*x)] + d^4*Cos[3*(e + f*x)])*
Sin[(e + f*x)/2])))/(48*a^2*f*(1 + Sin[e + f*x])^2)

________________________________________________________________________________________

Maple [A]
time = 0.46, size = 250, normalized size = 1.28 Too large to display

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*sin(f*x+e))^4/(a+a*sin(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

2/f/a^2*(-(c^4-6*c^2*d^2+8*c*d^3-3*d^4)/(tan(1/2*f*x+1/2*e)+1)-1/2*(-2*c^4+8*c^3*d-12*c^2*d^2+8*c*d^3-2*d^4)/(
tan(1/2*f*x+1/2*e)+1)^2-1/3*(2*c^4-8*c^3*d+12*c^2*d^2-8*c*d^3+2*d^4)/(tan(1/2*f*x+1/2*e)+1)^3+d^2*((1/2*d^2*ta
n(1/2*f*x+1/2*e)^3+(-4*c*d+2*d^2)*tan(1/2*f*x+1/2*e)^2-1/2*d^2*tan(1/2*f*x+1/2*e)-4*c*d+2*d^2)/(1+tan(1/2*f*x+
1/2*e)^2)^2+1/2*(12*c^2-16*c*d+7*d^2)*arctan(tan(1/2*f*x+1/2*e))))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 986 vs. \(2 (194) = 388\).
time = 0.53, size = 986, normalized size = 5.06 \begin {gather*} \frac {d^{4} {\left (\frac {\frac {75 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {97 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {126 \, \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {98 \, \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {63 \, \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {21 \, \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} + 32}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {5 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {7 \, a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {7 \, a^{2} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {5 \, a^{2} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} + \frac {a^{2} \sin \left (f x + e\right )^{7}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{7}}} + \frac {21 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} - 16 \, c d^{3} {\left (\frac {\frac {12 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {11 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {9 \, \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {3 \, \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + 5}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {4 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {4 \, a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {a^{2} \sin \left (f x + e\right )^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}}} + \frac {3 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} + 12 \, c^{2} d^{2} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 4}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} + \frac {3 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} - \frac {2 \, c^{4} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 2\right )}}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}} - \frac {8 \, c^{3} d {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}}{a^{2} + \frac {3 \, a^{2} \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a^{2} \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {a^{2} \sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))^4/(a+a*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/3*(d^4*((75*sin(f*x + e)/(cos(f*x + e) + 1) + 97*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 126*sin(f*x + e)^3/(c
os(f*x + e) + 1)^3 + 98*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 63*sin(f*x + e)^5/(cos(f*x + e) + 1)^5 + 21*sin(
f*x + e)^6/(cos(f*x + e) + 1)^6 + 32)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 5*a^2*sin(f*x + e)^2/(cos
(f*x + e) + 1)^2 + 7*a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 7*a^2*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + 5*a
^2*sin(f*x + e)^5/(cos(f*x + e) + 1)^5 + 3*a^2*sin(f*x + e)^6/(cos(f*x + e) + 1)^6 + a^2*sin(f*x + e)^7/(cos(f
*x + e) + 1)^7) + 21*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) - 16*c*d^3*((12*sin(f*x + e)/(cos(f*x + e) +
 1) + 11*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 9*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*sin(f*x + e)^4/(cos(f
*x + e) + 1)^4 + 5)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 4*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 +
 4*a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3 + 3*a^2*sin(f*x + e)^4/(cos(f*x + e) + 1)^4 + a^2*sin(f*x + e)^5/(c
os(f*x + e) + 1)^5) + 3*arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a^2) + 12*c^2*d^2*((9*sin(f*x + e)/(cos(f*x +
e) + 1) + 3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 4)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(
f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3) + 3*arctan(sin(f*x + e)/(cos(f*x +
e) + 1))/a^2) - 2*c^4*(3*sin(f*x + e)/(cos(f*x + e) + 1) + 3*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + 2)/(a^2 + 3
*a^2*sin(f*x + e)/(cos(f*x + e) + 1) + 3*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x
 + e) + 1)^3) - 8*c^3*d*(3*sin(f*x + e)/(cos(f*x + e) + 1) + 1)/(a^2 + 3*a^2*sin(f*x + e)/(cos(f*x + e) + 1) +
 3*a^2*sin(f*x + e)^2/(cos(f*x + e) + 1)^2 + a^2*sin(f*x + e)^3/(cos(f*x + e) + 1)^3))/f

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 452 vs. \(2 (194) = 388\).
time = 0.38, size = 452, normalized size = 2.32 \begin {gather*} -\frac {3 \, d^{4} \cos \left (f x + e\right )^{4} - 2 \, c^{4} + 8 \, c^{3} d - 12 \, c^{2} d^{2} + 8 \, c d^{3} - 2 \, d^{4} + 6 \, {\left (4 \, c d^{3} - d^{4}\right )} \cos \left (f x + e\right )^{3} + 6 \, {\left (12 \, c^{2} d^{2} - 16 \, c d^{3} + 7 \, d^{4}\right )} f x - {\left (2 \, c^{4} + 16 \, c^{3} d - 60 \, c^{2} d^{2} + 88 \, c d^{3} - 31 \, d^{4} + 3 \, {\left (12 \, c^{2} d^{2} - 16 \, c d^{3} + 7 \, d^{4}\right )} f x\right )} \cos \left (f x + e\right )^{2} - {\left (4 \, c^{4} + 8 \, c^{3} d - 48 \, c^{2} d^{2} + 104 \, c d^{3} - 38 \, d^{4} - 3 \, {\left (12 \, c^{2} d^{2} - 16 \, c d^{3} + 7 \, d^{4}\right )} f x\right )} \cos \left (f x + e\right ) + {\left (3 \, d^{4} \cos \left (f x + e\right )^{3} + 2 \, c^{4} - 8 \, c^{3} d + 12 \, c^{2} d^{2} - 8 \, c d^{3} + 2 \, d^{4} + 6 \, {\left (12 \, c^{2} d^{2} - 16 \, c d^{3} + 7 \, d^{4}\right )} f x - 3 \, {\left (8 \, c d^{3} - 3 \, d^{4}\right )} \cos \left (f x + e\right )^{2} - {\left (2 \, c^{4} + 16 \, c^{3} d - 60 \, c^{2} d^{2} + 112 \, c d^{3} - 40 \, d^{4} - 3 \, {\left (12 \, c^{2} d^{2} - 16 \, c d^{3} + 7 \, d^{4}\right )} f x\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{6 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} - a^{2} f \cos \left (f x + e\right ) - 2 \, a^{2} f - {\left (a^{2} f \cos \left (f x + e\right ) + 2 \, a^{2} f\right )} \sin \left (f x + e\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))^4/(a+a*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

-1/6*(3*d^4*cos(f*x + e)^4 - 2*c^4 + 8*c^3*d - 12*c^2*d^2 + 8*c*d^3 - 2*d^4 + 6*(4*c*d^3 - d^4)*cos(f*x + e)^3
 + 6*(12*c^2*d^2 - 16*c*d^3 + 7*d^4)*f*x - (2*c^4 + 16*c^3*d - 60*c^2*d^2 + 88*c*d^3 - 31*d^4 + 3*(12*c^2*d^2
- 16*c*d^3 + 7*d^4)*f*x)*cos(f*x + e)^2 - (4*c^4 + 8*c^3*d - 48*c^2*d^2 + 104*c*d^3 - 38*d^4 - 3*(12*c^2*d^2 -
 16*c*d^3 + 7*d^4)*f*x)*cos(f*x + e) + (3*d^4*cos(f*x + e)^3 + 2*c^4 - 8*c^3*d + 12*c^2*d^2 - 8*c*d^3 + 2*d^4
+ 6*(12*c^2*d^2 - 16*c*d^3 + 7*d^4)*f*x - 3*(8*c*d^3 - 3*d^4)*cos(f*x + e)^2 - (2*c^4 + 16*c^3*d - 60*c^2*d^2
+ 112*c*d^3 - 40*d^4 - 3*(12*c^2*d^2 - 16*c*d^3 + 7*d^4)*f*x)*cos(f*x + e))*sin(f*x + e))/(a^2*f*cos(f*x + e)^
2 - a^2*f*cos(f*x + e) - 2*a^2*f - (a^2*f*cos(f*x + e) + 2*a^2*f)*sin(f*x + e))

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 8950 vs. \(2 (185) = 370\).
time = 9.53, size = 8950, normalized size = 45.90 \begin {gather*} \text {Too large to display} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))**4/(a+a*sin(f*x+e))**2,x)

[Out]

Piecewise((-12*c**4*tan(e/2 + f*x/2)**6/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**
2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 +
f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 12*c**4*tan(e/2 + f*x/2)**5/(6*a**2*f*tan(e/2 + f*x/2)**7
 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*t
an(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 32*c**4*tan(e/2
+ f*x/2)**4/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42
*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/
2 + f*x/2) + 6*a**2*f) - 24*c**4*tan(e/2 + f*x/2)**3/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2
)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2
*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 28*c**4*tan(e/2 + f*x/2)**2/(6*a**2*f*tan(e/
2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4
+ 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 12*
c**4*tan(e/2 + f*x/2)/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/
2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**
2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 8*c**4/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a
**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2
+ f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 48*c**3*d*tan(e/2 + f*x/2)**5/(6*a**2*f*tan(e/2 + f*x/2
)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2
*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 16*c**3*d*ta
n(e/2 + f*x/2)**4/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**
5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*
tan(e/2 + f*x/2) + 6*a**2*f) - 96*c**3*d*tan(e/2 + f*x/2)**3/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2
 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 +
 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 32*c**3*d*tan(e/2 + f*x/2)**2/(6*a**
2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 +
f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**
2*f) - 48*c**3*d*tan(e/2 + f*x/2)/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*ta
n(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)
**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) - 16*c**3*d/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f
*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*
a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) + 36*c**2*d**2*f*x*tan(e/2 + f*x/2)**7/(6*
a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2
 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*
a**2*f) + 108*c**2*d**2*f*x*tan(e/2 + f*x/2)**6/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6
+ 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*ta
n(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) + 180*c**2*d**2*f*x*tan(e/2 + f*x/2)**5/(6*a**2*f*t
an(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2
)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f)
+ 252*c**2*d**2*f*x*tan(e/2 + f*x/2)**4/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**
2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 +
f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) + 252*c**2*d**2*f*x*tan(e/2 + f*x/2)**3/(6*a**2*f*tan(e/2 +
 f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 4
2*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) + 180*c*
*2*d**2*f*x*tan(e/2 + f*x/2)**2/(6*a**2*f*tan(e/2 + f*x/2)**7 + 18*a**2*f*tan(e/2 + f*x/2)**6 + 30*a**2*f*tan(
e/2 + f*x/2)**5 + 42*a**2*f*tan(e/2 + f*x/2)**4 + 42*a**2*f*tan(e/2 + f*x/2)**3 + 30*a**2*f*tan(e/2 + f*x/2)**
2 + 18*a**2*f*tan(e/2 + f*x/2) + 6*a**2*f) + 10...

________________________________________________________________________________________

Giac [A]
time = 0.44, size = 338, normalized size = 1.73 \begin {gather*} \frac {\frac {3 \, {\left (12 \, c^{2} d^{2} - 16 \, c d^{3} + 7 \, d^{4}\right )} {\left (f x + e\right )}}{a^{2}} + \frac {6 \, {\left (d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 8 \, c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 4 \, d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 8 \, c d^{3} + 4 \, d^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )}^{2} a^{2}} - \frac {4 \, {\left (3 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 18 \, c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 24 \, c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 9 \, d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 3 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 12 \, c^{3} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 54 \, c^{2} d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 60 \, c d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 21 \, d^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, c^{4} + 4 \, c^{3} d - 24 \, c^{2} d^{2} + 28 \, c d^{3} - 10 \, d^{4}\right )}}{a^{2} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}^{3}}}{6 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))^4/(a+a*sin(f*x+e))^2,x, algorithm="giac")

[Out]

1/6*(3*(12*c^2*d^2 - 16*c*d^3 + 7*d^4)*(f*x + e)/a^2 + 6*(d^4*tan(1/2*f*x + 1/2*e)^3 - 8*c*d^3*tan(1/2*f*x + 1
/2*e)^2 + 4*d^4*tan(1/2*f*x + 1/2*e)^2 - d^4*tan(1/2*f*x + 1/2*e) - 8*c*d^3 + 4*d^4)/((tan(1/2*f*x + 1/2*e)^2
+ 1)^2*a^2) - 4*(3*c^4*tan(1/2*f*x + 1/2*e)^2 - 18*c^2*d^2*tan(1/2*f*x + 1/2*e)^2 + 24*c*d^3*tan(1/2*f*x + 1/2
*e)^2 - 9*d^4*tan(1/2*f*x + 1/2*e)^2 + 3*c^4*tan(1/2*f*x + 1/2*e) + 12*c^3*d*tan(1/2*f*x + 1/2*e) - 54*c^2*d^2
*tan(1/2*f*x + 1/2*e) + 60*c*d^3*tan(1/2*f*x + 1/2*e) - 21*d^4*tan(1/2*f*x + 1/2*e) + 2*c^4 + 4*c^3*d - 24*c^2
*d^2 + 28*c*d^3 - 10*d^4)/(a^2*(tan(1/2*f*x + 1/2*e) + 1)^3))/f

________________________________________________________________________________________

Mupad [B]
time = 9.21, size = 478, normalized size = 2.45 \begin {gather*} \frac {d^2\,\mathrm {atan}\left (\frac {d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (12\,c^2-16\,c\,d+7\,d^2\right )}{12\,c^2\,d^2-16\,c\,d^3+7\,d^4}\right )\,\left (12\,c^2-16\,c\,d+7\,d^2\right )}{a^2\,f}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5\,\left (2\,c^4+8\,c^3\,d-36\,c^2\,d^2+48\,c\,d^3-21\,d^4\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\,\left (4\,c^4+16\,c^3\,d-72\,c^2\,d^2+112\,c\,d^3-42\,d^4\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (\frac {16\,c^4}{3}+\frac {8\,c^3\,d}{3}-40\,c^2\,d^2+\frac {224\,c\,d^3}{3}-\frac {98\,d^4}{3}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {14\,c^4}{3}+\frac {16\,c^3\,d}{3}-44\,c^2\,d^2+\frac {256\,c\,d^3}{3}-\frac {97\,d^4}{3}\right )+\frac {80\,c\,d^3}{3}+\frac {8\,c^3\,d}{3}+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6\,\left (2\,c^4-12\,c^2\,d^2+16\,c\,d^3-7\,d^4\right )+\frac {4\,c^4}{3}-\frac {32\,d^4}{3}+\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (2\,c^4+8\,c^3\,d-36\,c^2\,d^2+64\,c\,d^3-25\,d^4\right )-16\,c^2\,d^2}{f\,\left (a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7+3\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+5\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+7\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+7\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+5\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+3\,a^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+a^2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*sin(e + f*x))^4/(a + a*sin(e + f*x))^2,x)

[Out]

(d^2*atan((d^2*tan(e/2 + (f*x)/2)*(12*c^2 - 16*c*d + 7*d^2))/(7*d^4 - 16*c*d^3 + 12*c^2*d^2))*(12*c^2 - 16*c*d
 + 7*d^2))/(a^2*f) - (tan(e/2 + (f*x)/2)^5*(48*c*d^3 + 8*c^3*d + 2*c^4 - 21*d^4 - 36*c^2*d^2) + tan(e/2 + (f*x
)/2)^3*(112*c*d^3 + 16*c^3*d + 4*c^4 - 42*d^4 - 72*c^2*d^2) + tan(e/2 + (f*x)/2)^4*((224*c*d^3)/3 + (8*c^3*d)/
3 + (16*c^4)/3 - (98*d^4)/3 - 40*c^2*d^2) + tan(e/2 + (f*x)/2)^2*((256*c*d^3)/3 + (16*c^3*d)/3 + (14*c^4)/3 -
(97*d^4)/3 - 44*c^2*d^2) + (80*c*d^3)/3 + (8*c^3*d)/3 + tan(e/2 + (f*x)/2)^6*(16*c*d^3 + 2*c^4 - 7*d^4 - 12*c^
2*d^2) + (4*c^4)/3 - (32*d^4)/3 + tan(e/2 + (f*x)/2)*(64*c*d^3 + 8*c^3*d + 2*c^4 - 25*d^4 - 36*c^2*d^2) - 16*c
^2*d^2)/(f*(5*a^2*tan(e/2 + (f*x)/2)^2 + 7*a^2*tan(e/2 + (f*x)/2)^3 + 7*a^2*tan(e/2 + (f*x)/2)^4 + 5*a^2*tan(e
/2 + (f*x)/2)^5 + 3*a^2*tan(e/2 + (f*x)/2)^6 + a^2*tan(e/2 + (f*x)/2)^7 + a^2 + 3*a^2*tan(e/2 + (f*x)/2)))

________________________________________________________________________________________